package com.lims.dao.common.impl;

import java.util.List;


import com.lims.dao.base.BaseDAOImpl;
import com.lims.dao.common.ITestOfProjectDAO;
import com.lims.po.common.TestOfProject;

public class TestOfProjectDAOImpl extends BaseDAOImpl<TestOfProject> implements ITestOfProjectDAO {
	private static final String className=TestOfProjectDAOImpl.class.toString();
	public List<TestOfProject> selectAll(){
		String hql="from TestOfProject order by pid";
		return super.ExecuteQuery(hql, className+"-->selectAll()");
	}
	public boolean saveTestOfProject(TestOfProject testOfProject){
		return super.saveObject(testOfProject, className+"-->saveTestOfProject(TestOfProject TestOfProject)")>0?true:false;
	}
	public boolean updateTestOfProject(TestOfProject testOfProject){
		return super.updateObject(testOfProject, className+"-->updateTestOfProject(TestOfProject TestOfProject)");
	}
	public boolean deleteTestOfProject(TestOfProject testOfProject){
		return super.deleteObject(testOfProject, className+"-->deleteTestOfProject(TestOfProject TestOfProject)");
	}
	public boolean selectTestOfProjectByTestOfProjectTitle(String TestOfProjectTitle){
		String hql="from TestOfProject where TestOfProjectName='"+TestOfProjectTitle+"'";
		return super.ExecuteQuery(hql, className+"-->selectTestOfProjectByTestOfProjectName(String TestOfProjectName)").size()==0?false:true;
	}
	public boolean deleteTestOfProjectById(int pid){
		String hql="delete from TestOfProject where pid="+pid;
		return super.ExecuteNonQuery(hql, className+"-->deleteTestOfProjectById(int pid)");
	}
	public boolean deleteTestOfProjectByProjectId(int projectId) {
		String hql="delete from TestOfProject where project.pid="+projectId;
		return super.ExecuteNonQuery(hql, className+"-->deleteTestOfProjectByProjectId(int projectId)");
	}
	public TestOfProject selectTestOfProjectById(int pid) {
		return super.selectById(pid, className+"-->selectTestOfProjectById(int pid)");
	}
}
